package com.aaa.day1106.day110603;

import java.util.stream.Stream;

/**
 * @author ${崔灿}
 * @date 2022/11/06 18:40
 **/

public class Test02 {
    public static void main(String[] args) {
        String[] arr1 = { "a", "b", "c", "d","k" };
        String[] arr2 = { "d", "e", "f", "g","p","l" };
        Stream<String> stream1 = Stream.of(arr1);
        Stream<String> stream2 = Stream.of(arr2);

        //合并流
        //Stream.concat(stream1, stream2).forEach(System.out ::println);

        //去重--distinct
        //Stream.concat(stream1, stream2).distinct().forEach(System.out ::println);

        //获取前n个元素--limit
        //Stream.concat(stream1, stream2).limit(5).forEach(System.out ::println);

        //跳过前n个元素
        Stream.concat(stream1, stream2).skip(1).forEach(System.out ::println);

    }
}
